//
//  YXDefine.h
//  TASWork
//
//  Created by YUSIR on 2018/1/8.
//  Copyright © 2018年 TAS-Mac. All rights reserved.
//

#ifndef YXDefine_h
#define YXDefine_h

// 1.判断是否为iOS7
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)

#define SCREEN_WINDOW [UIApplication sharedApplication].keyWindow

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#define SCREEN_BOUNDS [UIScreen mainScreen].bounds
#define NAVIBAR_HEIGHT_IPHONE_PORTRAIT 44
#define NAVIBAR_HEIGHT_IPHONE_LANDSCAPE 32
#define STATUSBAR_HEIGHT_IPHONE [[UIApplication sharedApplication] statusBarFrame].size.height

#define TABBAR_HEIGHT_IPHONE 49

#define SCREEN_HEIGHT_IPHONE4 480
#define SCREEN_HEIGHT_IPHONE5 568
#define SCREEN_HEIGHT_IPHONE6 667
#define SCREEN_HEIGHT_IPHONE6P 736

#define SCREEN_WIDTH_IPHONE4 320
#define SCREEN_WIDTH_IPHONE5 320
#define SCREEN_WIDTH_IPHONE6 375
#define SCREEN_WIDTH_IPHONE6P 414
#define NAVIGATION_BAR_HEIGHT (SCREEN_HEIGHT == 812.0 ? 88 : 64)
#define SafeAreaBottomHeight (SCREEN_HEIGHT == 812.0 ? 34 : 0)
//#define NAVIGATION_BAR_HEIGHT (NAVIBAR_HEIGHT_IPHONE_PORTRAIT + STATUSBAR_HEIGHT_IPHONE)

//防止循环引用宏 __weak typeof(self) weakSelf = self;
//调用要加@， @WeakObj(self)
#define WeakObj(o) autoreleasepool{} __weak typeof(o) o##Weak = o;
#define StrongObj(o) autoreleasepool{} __strong typeof(o) o = o##Weak;


#define punchViewWidth 100

/***********屏幕适配*************/
#define iphone8P (SCREEN_HEIGHT == 736)
#define iphone8 (SCREEN_HEIGHT == 667)
#define iphone5 (SCREEN_HEIGHT == 568)
#define iphone4 (SCREEN_HEIGHT == 480)
/***********屏幕适配*************/

#endif /* YXDefine_h */
